from functools import partial
import sys
import os

from .multiagentenv import MultiAgentEnv

from .starcraft import StarCraft2Env
# from .myenv import EqualLine,Consensus
from .matrix_game_env import matrix_gameEnv
from .bridge import BridgeEnvironment


def env_fn(env, **kwargs) -> MultiAgentEnv:
    return env(**kwargs)

REGISTRY = {}
REGISTRY["sc2"] = partial(env_fn, env=StarCraft2Env)
# REGISTRY["equal_line"] = partial(env_fn, env=EqualLine)
# REGISTRY["consensus"] = partial(env_fn, env=Consensus)
REGISTRY["2action_matrix_game"] = partial(env_fn, env=matrix_gameEnv)
REGISTRY["3action_matrix_game"] = partial(env_fn, env=matrix_gameEnv)
REGISTRY["4action_matrix_game"] = partial(env_fn, env=matrix_gameEnv)
REGISTRY["bridge"] = partial(env_fn, env=BridgeEnvironment, tabular_states=False)

if sys.platform == "linux":
    os.environ.setdefault("SC2PATH", "~/StarCraftII")
